<?php


class dbaSites {

  function dbaSites (&$dba){
    $this->dba = &$dba;
  }

  function add ($name,$description,$url,$relUrl,$exportPath){
    $this->dba->query("insert into ".$this->dba->tableforwarder."_cmsSite (name,description,url,relUrl,exportPath) values ("
        .$this->dba->genQuotedFieldStr(array($name,$description,$url,$relUrl,$exportPath)).");");
    return $this->dba->insert_id();
  }

  function del ($id){
    return $this->dba->query("delete from ".$this->dba->tableforwarder."_cmsSite where siteid='$id';");
  }

 function update ($siteid,$name,$description,$url,$relUrl,$exportPath){
   return $this->dba->query("update ".$this->dba->tableforwarder."_cmsSite set  "
      .$this->dba->genUpdateFieldStr(array('siteid' => $siteid, 'name'=>$name, 'description'=>$description, 'url'=>$url, 'relUrl' =>$relUrl, 'exportPath'=>$exportPath))." where siteid=$siteid;");
 }

 function get ($siteid){
   $this->dba->query("select * from ".$this->dba->tableforwarder."_cmsSite where siteid='$siteid';");
   return $this->dba->fetch_row_array();
 }

 function getall (){
   $this->dba->query("select * from ".$this->dba->tableforwarder."_cmsSite order by name;");
   return $this->dba->fetch_rows_array();
 }

}

?>
